/*******************************************
 * Copyright 2007 Aphrodite Framework for javaME .
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the GNU Public License v2.0
 * which accompanies this distribution, and is available at
 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
 * Email : owner@aphroditeme.dev.java.net
 * Contributors:
 *     Kent Elton - initial API and implementation
 *******************************************/

package com.aphrodite.xml.wap;

import com.aphrodite.xml.Xml;

class Tag extends ParseEvent {

	StartTag parent;
	String namespace;
	String name;

	Tag(int type, StartTag parent, String namespace, String name) {
		super(type, null);
		this.parent = parent;
		this.namespace = namespace == null ? Xml.NO_NAMESPACE : namespace;
		this.name = name;
	}

	/** returns the (local) name of the element */

	public String getName() {
		return name;
	}

	/** returns the namespace */

	public String getNamespace() {
		return namespace;
	}

	/**
	 * Returns the (corresponding) start tag or the start tag of the parent
	 * element, depending on the event type.
	 */

	StartTag getParent() {
		return parent;
	}

	public String toString() {
		return "EndTag </" + name + ">";
	}
}
